# Rebuilding derived panels from local raw archives (no redistribution)

This project’s raw inputs are stored outside the repository (on local disks) and must be treated as **read-only**. This replication package does **not** include any raw archives.

If you have access to the raw archives on your machine, you can reconstruct the derived panels as follows:

1) In the repo root, create a local config file:

```bash
cp media_project/config.example.json media_project/config.json
```

2) Edit `media_project/config.json` to point to your local raw files (CSV/XLSX). Do **not** commit it.

3) Rebuild the derived panels:

```bash
python3 media_project/scripts/build_env_policy_panel.py
python3 media_project/scripts/build_gov_wechat_topic_index.py
python3 media_project/scripts/aggregate_gov_wechat_topic_index.py
python3 media_project/scripts/build_env_media_panel.py
```

4) Run the analysis and regenerate figures:

```bash
python3 media_project/scripts/analyze_env_policy_effects.py \
  --panel media_project/out/env_policy_city_year_with_wechat.csv \
  --report media_project/reports/env_policy_results.md \
  --fig-dir media_project/reports/assets
```

Notes:
- The manuscript’s main air-quality results use the `days >= 330` quality screen.
- The package includes derived CSVs so rebuild is optional for replication.
